package com.tfswue.cxy.controller;

import com.tfswue.cxy.service.EnventPublisherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class RegestController {
    @Autowired
    private EnventPublisherService enventPublisher;

    @PostMapping("/register")
    public ResponseEntity< String> registerUser(
            @RequestParam String username,
            @RequestParam String email) {
            enventPublisher.pubilshUserRegistered(username, email);
            return ResponseEntity.ok("用户注册成功");
        }
    }

